home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 August / CICA - The Ultimate Collection of Shareware for Windows (Disc 2) (August 1995).iso / disc2 / nt / cmd600.exe / OEMSETUP.INF < prev    next >
INI File  |  1993-08-23  |  19KB  |  579 lines

  1. ;-----------------------------------------------------------------------
  2. ; OPTION TYPE
  3. ; -----------
  4. ; This identifies the Option type we are dealing with.  The different
  5. ; possible types are:
  6. ;
  7. ; COMPUTER, VIDEO, POINTER, KEYBOARD, LAYOUT, SCSI, TAPE, PRINTER, ...
  8. ;-----------------------------------------------------------------------
  9.  
  10. [Identification]
  11.     OptionType = SCSI
  12.  
  13. ;-----------------------------------------------------------------------
  14. ; LANGUAGES SUPPORTED
  15. ; -------------------
  16. ;
  17. ; The languages supported by the INF, For every language supported
  18. ; we need to have a separate text section for every displayable text
  19. ; section.
  20. ;
  21. ;-----------------------------------------------------------------------
  22.  
  23. [LanguagesSupported]
  24.     ENG
  25.  
  26.  
  27. ;-----------------------------------------------------------------------
  28. ; OPTION LIST
  29. ; -----------
  30. ; This section lists the Option key names.  These keys are locale
  31. ; independent and used to represent the option in a locale independent
  32. ; manner.
  33. ;
  34. ;-----------------------------------------------------------------------
  35.  
  36. [Options]
  37.     "csa6000"    = csa6000
  38.  
  39. ;-----------------------------------------------------------------------
  40. ; OPTION TEXT SECTION
  41. ; -------------------
  42. ; These are text strings used to identify the option to the user.  There
  43. ; are separate sections for each language supported.  The format of the
  44. ; section name is "OptionsText" concatenated with the Language represented
  45. ; by the section.
  46. ;
  47. ;-----------------------------------------------------------------------
  48.  
  49. [OptionsTextENG]
  50.     "csa6000"    = "CMD CSA-6000 SCSI Host Adapter Driver"
  51.  
  52.  
  53. ;-----------------------------------------------------------------------------------------
  54. ; SCSI MINIPORT DRIVERS:
  55. ;
  56. ; Order of the information:
  57. ;
  58. ; Class driver = Type, Group, ErrorControl, Tag, EventMessageFile, TypesSupported
  59. ;
  60. ;-----------------------------------------------------------------------------------------
  61.  
  62. [MiniportDrivers]
  63.     csa6000  = !SERVICE_KERNEL_DRIVER, "SCSI Miniport", !SERVICE_ERROR_NORMAL,  25, %SystemRoot%\System32\IoLogMsg.dll , 7
  64.  
  65. ;---------------------------------------------------------------------------
  66. ; 1. Identify
  67. ;
  68. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  69. ;                as we are choosing currently.
  70. ;
  71. ; INPUT:         None
  72. ;
  73. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  74. ;                $($R1): Option Type (COMPUTER ...)
  75. ;                $($R2): Diskette description
  76. ;---------------------------------------------------------------------------
  77.  
  78. [Identify]
  79.     ;
  80.     ;
  81.     read-syms Identification
  82.  
  83.     set Status     = STATUS_SUCCESSFUL
  84.     set Identifier = $(OptionType)
  85.     set Media      = #("Source Media Descriptions", 1, 1)
  86.  
  87.     Return $(Status) $(Identifier) $(Media)
  88.  
  89.  
  90.  
  91. ;------------------------------------------------------------------------
  92. ; 2. ReturnOptions:
  93. ;
  94. ; DESCRIPTION:   To return the option list supported by this INF and the
  95. ;                localised text list representing the options.
  96. ;
  97. ;
  98. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  99. ;
  100. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  101. ;                                STATUS_NOLANGUAGE
  102. ;                                STATUS_FAILED
  103. ;
  104. ;                $($R1): Option List
  105. ;                $($R2): Option Text List
  106. ;------------------------------------------------------------------------
  107.  
  108. [ReturnOptions]
  109.     ;
  110.     ;
  111.     set Status        = STATUS_FAILED
  112.     set OptionList     = {}
  113.     set OptionTextList = {}
  114.  
  115.     ;
  116.     ; Check if the language requested is supported
  117.     ;
  118.     set LanguageList = ^(LanguagesSupported, 1)
  119.     Ifcontains(i) $($0) in $(LanguageList)
  120.         goto returnoptions
  121.     else
  122.         set Status = STATUS_NOLANGUAGE
  123.         goto finish_ReturnOptions
  124.     endif
  125.  
  126.     ;
  127.     ; form a list of all the options and another of the text representing
  128.     ;
  129.  
  130. returnoptions = +
  131.     set OptionList     = ^(Options, 0)
  132.     set OptionTextList = ^(OptionsText$($0), 1)
  133.     set Status         = STATUS_SUCCESSFUL
  134.  
  135. finish_ReturnOptions = +
  136.     Return $(Status) $(OptionList) $(OptionTextList)
  137.  
  138.  
  139. ;
  140. ; 3. InstallOption:
  141. ;
  142. ; FUNCTION:  To copy files representing Options
  143. ;            To configure the installed option
  144. ;            To update the registry for the installed option
  145. ;
  146. ; INPUT:     $($0):  Language to use
  147. ;            $($1):  OptionID to install
  148. ;            $($2):  SourceDirectory
  149. ;            $($3):  AddCopy  (YES | NO)
  150. ;            $($4):  DoCopy   (YES | NO)
  151. ;            $($5):  DoConfig (YES | NO)
  152. ;
  153. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  154. ;                            STATUS_NOLANGUAGE |
  155. ;                            STATUS_USERCANCEL |
  156. ;                            STATUS_FAILED
  157. ;
  158.  
  159. [InstallOption]
  160.  
  161.     ;
  162.     ; Set default values for
  163.     ;
  164.     set Status = STATUS_FAILED
  165.     set DrivesToFree = {}
  166.  
  167.     ;
  168.     ; extract parameters
  169.     ;
  170.     set Option   = $($1)
  171.     set SrcDir   = $($2)
  172.     set AddCopy  = $($3)
  173.     set DoCopy   = $($4)
  174.     set DoConfig = $($5)
  175.  
  176.     ;
  177.     ; Check if the language requested is supported
  178.     ;
  179.     set LanguageList = ^(LanguagesSupported, 1)
  180.     Ifcontains(i) $($0) in $(LanguageList)
  181.     else
  182.         set Status = STATUS_NOLANGUAGE
  183.         goto finish_InstallOption
  184.     endif
  185.     read-syms Strings$($0)
  186.  
  187.     ;
  188.     ; check to see if Option is supported.
  189.     ;
  190.  
  191.     set OptionList = ^(Options, 0)
  192.     ifcontains $(Option) in $(OptionList)
  193.     else
  194.         Debug-Output "SCSI.INF: SCSI option is not supported."
  195.         goto finish_InstallOption
  196.     endif
  197.     set OptionList = ""
  198.  
  199.     ;
  200.     ; Option has been defined already
  201.     ;
  202.  
  203.     set MiniportDriver   =   #(Options,         $(Option),         1)
  204.     set Type             = $(#(MiniportDrivers, $(MiniportDriver), 1))
  205.     set Group            =   #(MiniportDrivers, $(MiniportDriver), 2)
  206.     set ErrorControl     = $(#(MiniportDrivers, $(MiniportDriver), 3))
  207.     set Tag              =   #(MiniportDrivers, $(MiniportDriver), 4)
  208.     set EventMessageFile =   #(MiniportDrivers, $(MiniportDriver), 5)
  209.     set TypesSupported   =   #(MiniportDrivers, $(MiniportDriver), 6)
  210.  
  211. ;    set Start            =   $(!SERVICE_SYSTEM_START)
  212. ;    shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  213. ;    ifint $($ShellCode) == $(!SHELL_CODE_OK)
  214. ;        ifstr(i) $($R0) == "STATUS_SUCCESSFUL"
  215. ;            ifstr(i) $($R1) == $(!SERVICE_BOOT_START)
  216. ;                set Start = $(!SERVICE_BOOT_START)
  217. ;            endif
  218. ;        endif
  219. ;    endif
  220.  
  221.     set Start            =   $(!SERVICE_BOOT_START)
  222.  
  223. installtheoption = +
  224.  
  225.     ;
  226.     ; Code to add files to copy list
  227.     ;
  228.  
  229.     ifstr(i) $(AddCopy) == "YES"
  230.         set DoActualCopy = NO
  231.         set FileToCheck = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  232.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\drivers\"$(FileToCheck)
  233.         ifstr(i) $(STATUS) == NO
  234.             set DoActualCopy = YES
  235.         endif
  236.  
  237.         ifstr(i) $(DoActualCopy) == NO
  238.             shell "subroutn.inf" DriversExist $($0) $(String1)
  239.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  240.                 Debug-Output "SCSI.INF: shelling DriversExist failed"
  241.                 goto finish_InstallOption
  242.             endif
  243.  
  244.             ifstr(i) $($R0) == STATUS_CURRENT
  245.             else-ifstr(i) $($R0) == STATUS_NEW
  246.                 set DoActualCopy = YES
  247.             else-ifstr(i) $($R0) == STATUS_USERCANCEL
  248.                 Debug-Output "SCSI.INF: User cancelled SCSI installation"
  249.                 goto finish_InstallOption
  250.             else
  251.                 Debug-Output "SCSI.INF: Error reported in DriversExist routine in SUBROUTN.INF"
  252.                 goto finish_InstallOption
  253.             endif
  254.         endif
  255.  
  256.         ifstr(i) $(DoActualCopy) == YES
  257.  
  258.             shell "subroutn.inf" DoAskSourceEx $(SrcDir) $(String2)
  259.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  260.                 Debug-Output "SCSI.INF: shelling DoAskSourceEx failed"
  261.                 goto finish_InstallOption
  262.             endif
  263.  
  264.             ifstr(i) $($R0) == STATUS_SUCCESSFUL
  265.                 set SrcDir = $($R1)
  266.                 ifstr(i) $($R2) != ""
  267.                     set DrivesToFree = >($(DrivesToFree), $($R2))
  268.                 endif
  269.             else
  270.                 Debug-Output "SCSI.INF: User cancelled asking source."
  271.                 goto finish_InstallOption
  272.             endif
  273.  
  274.             install Install-AddCopyOption
  275.             ifstr(i) $(STF_INSTALL_OUTCOME) != "STF_SUCCESS"
  276.                 Debug-Output "Adding SCSI files to copy list failed"
  277.                 goto finish_InstallOption
  278.             endif
  279.         else
  280.             set DoCopy = NO
  281.         endif
  282.  
  283.     endif
  284.  
  285.     ifstr(i) $(DoCopy) == "YES"
  286.         read-syms ProgressCopy$($0)
  287.         install Install-DoCopyOption
  288.         ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  289.             Debug-Output "Copying files failed"
  290.             goto finish_InstallOption
  291.         else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  292.             set Status = STATUS_USERCANCEL
  293.             goto finish_InstallOption
  294.         endif
  295.     endif
  296.  
  297.     ifstr(i) $(DoConfig) == "YES"
  298.         ;
  299.         ; first run a privilege check on modifying the setup node
  300.         ;
  301.  
  302.         shell "registry.inf" CheckSetupModify
  303.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  304.             goto finish_InstallOption
  305.         endif
  306.  
  307.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  308.             goto finish_InstallOption
  309.         endif
  310.  
  311.         ;
  312.         ; then make a new SCSI entry, the entry is created automatically
  313.         ; enabled
  314.         ;
  315.  
  316.         set ServiceNode   = $(MiniportDriver)
  317.         set ServiceBinary = %SystemRoot%\System32\drivers\#(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  318.  
  319.         set ServicesValues   = { +
  320.                 {Type,           0, $(!REG_VT_DWORD),     $(Type)                  }, +
  321.                 {Start,          0, $(!REG_VT_DWORD),     $(Start)                 }, +
  322.                 {Group,          0, $(!REG_VT_SZ),        $(Group)                 }, +
  323.                 {ErrorControl,   0, $(!REG_VT_DWORD),     $(ErrorControl)          }, +
  324.                 {Tag,            0, $(!REG_VT_DWORD),     $(Tag)                   }, +
  325.                 {BinaryPathName, 0, $(!REG_VT_EXPAND_SZ), $(ServiceBinary)         }  +
  326.                 }
  327.         set ParametersValues = ""
  328.         set DeviceValues     = {}
  329.         set EventLogValues   = { +
  330.                 {EventMessageFile, 0, $(!REG_VT_EXPAND_SZ), $(EventMessageFile) }, +
  331.                 {TypesSupported,   0, $(!REG_VT_DWORD),     $(TypesSupported)   }  +
  332.                 }
  333.  
  334.         shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  335.                                                 $(ServicesValues)   +
  336.                                                 $(ParametersValues) +
  337.                                                 $(DeviceValues)     +
  338.                                                 $(EventLogValues)   +
  339.                                                 Parameters
  340.  
  341.  
  342.  
  343.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  344.             Debug-Output "Couldn't execute MakeServicesEntry in registry.inf"
  345.             goto finish_InstallOption
  346.         endif
  347.  
  348.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  349.             Debug-Output "MakeServicesEntry failed for SCSI"
  350.             goto finish_InstallOption
  351.         endif
  352.  
  353.     endif
  354.  
  355.     set Status = STATUS_SUCCESSFUL
  356. finish_InstallOption = +
  357.     ForListDo $(DrivesToFree)
  358.         LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
  359.     EndForListDo
  360.  
  361.     Return $(Status)
  362.  
  363.  
  364. [Install-AddCopyOption]
  365.  
  366.     ;
  367.     ; Add the files to the copy list
  368.     ;
  369.     AddSectionKeyFileToCopyList   Files-ScsiMiniportDrivers         +
  370.                                   $(MiniportDriver)                 +
  371.                                   $(SrcDir)                      +
  372.                                   $(!STF_WINDOWSSYSPATH)\drivers
  373.  
  374.     exit
  375.  
  376.  
  377. [Install-DoCopyOption]
  378.  
  379.     ;
  380.     ; Copy files in the copy list
  381.     ;
  382.     CopyFilesInCopyList
  383.     exit
  384.  
  385. ;-------------------------------------------------------------------------
  386. ; 4. DeInstallOption:
  387. ;
  388. ; FUNCTION:  To remove files representing Option
  389. ;            To remove the registry entry corresponding to the Option
  390. ;
  391. ; INPUT:     $($0):  Language to use
  392. ;            $($1):  OptionID to install
  393. ;
  394. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  395. ;                            STATUS_NOLANGUAGE |
  396. ;                            STATUS_USERCANCEL |
  397. ;                            STATUS_FAILED
  398. ;-------------------------------------------------------------------------
  399. [DeInstallOption]
  400.     ;
  401.     ; Set default values for
  402.     ;
  403.     set Status   = STATUS_FAILED
  404.     ;
  405.     ; extract parameters
  406.     ;
  407.     set Option   = $($1)
  408.  
  409.     ;
  410.     ; Check if the language requested is supported
  411.     ;
  412.     set LanguageList = ^(LanguagesSupported, 1)
  413.     Ifcontains(i) $($0) in $(LanguageList)
  414.     else
  415.         set Status = STATUS_NOLANGUAGE
  416.         goto finish_DeInstallOption
  417.     endif
  418.     read-syms Strings$($0)
  419.  
  420.     ;
  421.     ; check to see if Option is supported.
  422.     ;
  423.  
  424.     set OptionList = ^(Options, 0)
  425.     ifcontains $(Option) in $(OptionList)
  426.     else
  427.         goto finish_DeInstallOption
  428.     endif
  429.     set OptionList = ""
  430.  
  431.     ;
  432.     ; fetch details about option
  433.     ;
  434.  
  435.     set MiniportDriver = #(Options, $(Option), 1)
  436.     set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  437.     set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  438.  
  439.     ;
  440.     ; check to see if file is installed
  441.     ; if not give success
  442.     ;
  443.  
  444.     LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  445.     ifstr(i) $(STATUS) == "NO"
  446.         set Status = STATUS_SUCCESSFUL
  447.         goto finish_DeInstallOption
  448.     endif
  449.  
  450.     shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  451.     ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  452.         ; this could happen if there is no start value or there is no
  453.         ; key, in which case the option is not installed
  454.         set Status = STATUS_SUCCESSFUL
  455.         goto finish_DeInstallOption
  456.     endif
  457.  
  458.     ifstr(i) $($R1) == $(!SERVICE_BOOT_START)
  459.         shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "WARNING" $(String3)
  460.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  461.             goto do_removal
  462.         endif
  463.         ifstr(i) $($R1) == "CANCEL"
  464.             goto finish_DeInstallOption
  465.         endif
  466.     endif
  467.  
  468. do_removal =+
  469.     ;
  470.     ; disable the registry entry
  471.     ;
  472.  
  473.     shell "registry.inf" RemoveServicesEntry $(MiniportDriver)
  474.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  475.         Debug-Output "SCSI.INF: Failed to shell RemoveServicesEntry"
  476.         goto finish_DeInstallOption
  477.     endif
  478.  
  479.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  480.         Debug-Output "SCSI.INF: Failed to disable services entry"
  481.         goto finish_DeInstallOption
  482.     endif
  483.  
  484.     ;
  485.     ; we won't remove the file because we can only do so during the next boot.
  486.     ; if the user chooses to reinstall the same driver during this boot
  487.     ; he will still end up deleting the driver on next boot. if the file
  488.     ; should be deleted a warning should be put up saying that the user should
  489.     ; not try to reinstall the driver during this boot
  490.     ;
  491.     ;    AddFileToDeleteList $(FilePath)
  492.  
  493.     set Status = STATUS_SUCCESSFUL
  494.  
  495. finish_DeInstallOption =+
  496.     return $(Status)
  497.  
  498.  
  499. ;-------------------------------------------------------------------------
  500. ; 5. GetInstalledOptions:
  501. ;
  502. ; FUNCTION:  To find out the list of options which are installed
  503. ;
  504. ; INPUT:     $($0): Language to Use
  505. ;
  506. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  507. ;                            STATUS_FAILED
  508. ;
  509. ;            $($R1): List of options installed
  510. ;            $($R2): Option installed Text List
  511. ;-------------------------------------------------------------------------
  512. [GetInstalledOptions]
  513.     set Status = STATUS_FAILED
  514.     set InstalledOptions = {}
  515.     set InstalledOptionsText = {}
  516.  
  517.     ;
  518.     ; Check if the language requested is supported
  519.     ;
  520.     set LanguageList = ^(LanguagesSupported, 1)
  521.     Ifcontains(i) $($0) in $(LanguageList)
  522.     else
  523.         set Status = STATUS_NOLANGUAGE
  524.         goto finish_GetInstalledOptions
  525.     endif
  526.  
  527.     set OptionList = ^(Options, 0)
  528.     ForListDo $(OptionList)
  529.         set MiniportDriver = #(Options, $($), 1)
  530.         set MiniportFile   = #(Files-ScsiMiniportDrivers, $(MiniportDriver), 2)
  531.         set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  532.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  533.         ifstr(i) $(STATUS) == "YES"
  534.             shell "registry.inf" GetServicesEntryStart $(MiniportDriver)
  535.             ifint $($ShellCode) == $(!SHELL_CODE_OK)
  536.                 ifstr(i) $($R0) == STATUS_SUCCESSFUL
  537.                     ifstr(i) $($R1) != $(!SERVICE_DISABLED)
  538.  
  539.                         set OptionText = #(OptionsText$($0), $($), 1)
  540.                         set InstalledOptions     = >($(InstalledOptions), $($))
  541.                         set InstalledOptionsText = >($(InstalledOptionsText), $(OptionText))
  542.  
  543.                     endif
  544.                 endif
  545.             endif
  546.         endif
  547.     EndForListDo
  548.     set Status = STATUS_SUCCESSFUL
  549. finish_GetInstalledOptions =+
  550.     Return $(Status) $(InstalledOptions) $(InstalledOptionsText)
  551.  
  552.  
  553. ;**************************************************************************
  554. ; PROGRESS GUAGE VARIABLES
  555. ;**************************************************************************
  556.  
  557. [ProgressCopyENG]
  558.     ProCaption   = "Windows NT Setup"
  559.     ProCancel    = "Cancel"
  560.     ProCancelMsg = "Windows NT is not correcly installed.  Are you sure you want "+
  561.                    "to cancel copying files?"
  562.     ProCancelCap = "Setup Message"
  563.     ProText1     = "Copying:"
  564.     ProText2     = "To:"
  565.  
  566. [StringsENG]
  567.     String1 = "CMD CSA-6000 SCSI Host Adapter"
  568.     String2 = "Please enter the full path to the CMD CSA-6000 SCSI "+
  569.               "Adapter files.  Then choose Continue."
  570.     String3 = "The CMD CSA-6000 SCSI Adapter has been marked as a boot device.  Removing "+
  571.               "it may cause the system not to boot."$(!LF)$(!LF)"Are you sure "+
  572.               "you want to remove the Adapter."
  573.  
  574. [Source Media Descriptions]
  575.     1  = "CMD CSA-6000 Distribution Disk"  , TAGFILE = csa6000.sys
  576.  
  577. [Files-ScsiMiniportDrivers]
  578. csa6000 = 1,csa6000.sys , SIZE=14848
  579.